package com.hbpu.encap.IO;

import java.io.*;

public class BufferedCopy {
    public static void main(String[] args) throws IOException {
        String path = "E:\\test.txt";
        String copyPath = "E:\\test1.txt";
        String line = null;
        BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter(copyPath));
        BufferedReader bufferedReader = new BufferedReader(new FileReader(path));

        while ((line = bufferedReader.readLine()) != null) {
            bufferedWriter.write(line);
            bufferedWriter.newLine();
        }
        bufferedReader.close();
        bufferedWriter.close();
    }
}
